<?php

namespace App\Models\ChinaBank;

use Illuminate\Database\Eloquent\Model;

class UserModel extends Model
{
    protected $table = "bank_user";
    protected $primaryKey = "user_id";
    protected $guarded = [];


    public static function wxRegister($wxinfo){

        $user = self::where('openid',$wxinfo['openid'])->first();
        if($user){
            return $user;
        }

        return self::create($wxinfo);
    }
}
